home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Mail / MailEnclosure / Source.v0.15 / TokenString.h < prev    next >
Text File  |  1995-06-12  |  1KB  |  42 lines

  1. /*
  2. ** TokenString.h,v 1.2 1992/05/21 22:47:25 nwc Exp
  3. **
  4. ** Copyright (c) 1991 Ronin Consulting, Inc.
  5. */
  6.  
  7. #import <objc/Storage.h>
  8. #import "StringStorage.h"
  9.  
  10. /*
  11. ** TokenString is a subclass of StringStorage which allows tokens, i.e. character
  12. ** sequences separated by a separator to be pulled from the string.
  13. */ 
  14.  
  15. @interface TokenString : StringStorage
  16. {
  17.    char separator;
  18.    char *start;
  19.    char lastEnd;
  20.    BOOL nullTokens;
  21. }
  22.  
  23. - init: (const char *) string;
  24.  
  25. - setStringValue: (const char *) string;
  26. - setSeparator: (char) aChar;             /* set the separator, a space ' ' is the default */
  27. - (char) separator;                 /* return current separator */
  28.  
  29. /* 
  30.  * do two separators in a row indicate a null token? If nullTokens is set to YES and
  31.  * the string contains two separators in a row then the -pop method will return a NULL.
  32.  * If nullTokens is set to NO (the default) then multiple sequential separators are treated
  33.  * as a single separator and the next non-null token is returned.
  34.  */
  35. - setNullTokens: (BOOL) toggle;
  36. - (BOOL) nullTokens;
  37.  
  38.  
  39. - (const char *) popStringValue;                 /* return the TokenString's next token */
  40.  
  41. @end
  42.